html{
    font-size: 14px;
}
body{
    display: grid;
    justify-content: center;
    align-content: center;
    width: 100vw;
    height: 100vh;
    nav{
        display: grid;
        grid-template-columns: repeat(5,100px);
        justify-items: center;
        overflow: hidden;
        a{
            text-decoration: none;
            font-size: 1rem;
            color: black;

            @for $i from 1 to 6 {
                &:nth-child(#{$i}).active ~.line{
                    transform: translateX(#{$i *100 - 100}px);
                }
                &[href]:hover:nth-child(#{$i}) ~.line{
                    transform: translateX(#{$i *100 - 100}px);
                }
            }

            // &:nth-child(1):hover ~.line{
            //     transform: translateX(0);
            // }
            // &:nth-child(2):hover ~.line{
            //     transform: translateX(100px);
            // }
            // &:nth-child(3):hover ~.line{
            //     transform: translateX(200px);
            // }
            // &:nth-child(4):hover ~.line{
            //     transform: translateX(300px);
            // }
            // &:nth-child(5):hover ~.line{
            //     transform: translateX(400px);
            // }
        }
        .line{
            background-color: chocolate;
            height: 2px;
            width: 60px;
            transition: 1s;
            transform: translateX(-100px);
        }
    }
}